libbpf: link shared object with libelf
authorHilko Bengen <bengen@debian.org>
Sun, 2 Dec 2018 23:26:03 +0000 (23:26 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 15 May 2019 22:07:16 +0000 (23:07 +0100)
libbpf.so needs to be linked against libelf to avoid missing symbols.

Signed-off-by: Hilko Bengen <bengen@debian.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name libbpf-link-shared-object-with-libelf.patch

tools/lib/bpf/Makefile

index eabc610ca75f8a7efa02ac5c3b75e5ad0e5af884..6729315cef37148c0a012f60fd6cf113ba851fe5 100644 (file)
@@ -162,7 +162,7 @@ $(BPF_IN): force elfdep bpfdep
        $(Q)$(MAKE) $(build)=libbpf
 
 $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN)
-       $(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,$(@F) -o $@
+       $(QUIET_LINK)$(CC) --shared $^ -lelf -Wl,-soname,$(@F) -o $@
 
 $(OUTPUT)libbpf.a: $(BPF_IN)
        $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^